From: Andrii Anisov Date: Thu, 3 Jul 2014 09:55:26 +0000 (+0300) Subject: xen/dt: add match for non-available nodes X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4713 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=aacb92ad5a0b18840f89667b9e5bdab047b35b0e;p=xen.git xen/dt: add match for non-available nodes Signed-off-by: Andrii Anisov Acked-by: Julien Grall Acked-by: Ian Campbell --- diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index f0b17a3115..310635ea7d 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -680,7 +680,8 @@ bool_t dt_match_node(const struct dt_device_match *matches, if ( !matches ) return 0; - while ( matches->path || matches->type || matches->compatible ) + while ( matches->path || matches->type || + matches->compatible || matches->not_available ) { bool_t match = 1; @@ -693,6 +694,9 @@ bool_t dt_match_node(const struct dt_device_match *matches, if ( matches->compatible ) match &= dt_device_is_compatible(node, matches->compatible); + if ( matches->not_available ) + match &= !dt_device_is_available(node); + if ( match ) return match; diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 25db076460..865e1ef0fe 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -65,11 +65,13 @@ struct dt_device_match { const char *path; const char *type; const char *compatible; + const bool_t not_available; }; #define DT_MATCH_PATH(p) { .path = p } #define DT_MATCH_TYPE(typ) { .type = typ } #define DT_MATCH_COMPATIBLE(compat) { .compatible = compat } +#define DT_MATCH_NOT_AVAILABLE() { .not_available = 1 } typedef u32 dt_phandle;